<title>「一本通 4.5 练习 3」染色</title><link href="http://hzoi.com/tomorrow.css" rel="stylesheet"><div class="ui existing segment"><pre><code><span class="pl-cp">#include</span><span class="pl-cpf">&lt;iostream&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;stdio.h&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;stdlib.h&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;string.h&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;math.h&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;vector&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;map&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;set&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;string&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;bitset&gt;</span><span class="pl-cp"></span>
<span class="pl-cp">#include</span><span class="pl-cpf">&lt;algorithm&gt;</span><span class="pl-cp"></span>
<span class="pl-k">using</span> <span class="pl-k">namespace</span> <span class="pl-n">std</span><span class="pl-p">;</span>
<span class="pl-cp">#define lson th&lt;&lt;1</span>
<span class="pl-cp">#define rson th&lt;&lt;1|1</span>
<span class="pl-k">typedef</span> <span class="pl-kt">long</span> <span class="pl-kt">long</span> <span class="pl-n">ll</span><span class="pl-p">;</span>
<span class="pl-k">typedef</span> <span class="pl-kt">long</span> <span class="pl-kt">double</span> <span class="pl-n">ldb</span><span class="pl-p">;</span>
<span class="pl-cp">#define inf 999999999</span>
<span class="pl-cp">#define pi acos(-1.0)</span>
<span class="pl-cp">#define maxn 100010</span>
<span class="pl-k">struct</span> <span class="pl-n">edge</span><span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">to</span><span class="pl-p">,</span><span class="pl-n">next</span><span class="pl-p">;</span>
<span class="pl-p">}</span><span class="pl-n">e</span><span class="pl-p">[</span><span class="pl-mi">2</span><span class="pl-o">*</span><span class="pl-n">maxn</span><span class="pl-p">];</span>
<span class="pl-kt">int</span> <span class="pl-n">pos</span><span class="pl-p">,</span><span class="pl-n">tot</span><span class="pl-p">,</span><span class="pl-n">Lc</span><span class="pl-p">,</span><span class="pl-n">Rc</span><span class="pl-p">;</span>
<span class="pl-kt">int</span> <span class="pl-n">top</span><span class="pl-p">[</span><span class="pl-n">maxn</span><span class="pl-p">],</span><span class="pl-n">son</span><span class="pl-p">[</span><span class="pl-n">maxn</span><span class="pl-p">],</span><span class="pl-n">fa</span><span class="pl-p">[</span><span class="pl-n">maxn</span><span class="pl-p">],</span><span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">maxn</span><span class="pl-p">],</span><span class="pl-n">num</span><span class="pl-p">[</span><span class="pl-n">maxn</span><span class="pl-p">],</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">maxn</span><span class="pl-p">],</span><span class="pl-n">a</span><span class="pl-p">[</span><span class="pl-n">maxn</span><span class="pl-p">],</span><span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">maxn</span><span class="pl-p">],</span><span class="pl-n">first</span><span class="pl-p">[</span><span class="pl-n">maxn</span><span class="pl-p">];</span>
<span class="pl-kt">void</span> <span class="pl-nf">dfs1</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">pre</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">deep</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">i</span><span class="pl-p">,</span><span class="pl-n">j</span><span class="pl-p">,</span><span class="pl-n">v</span><span class="pl-p">;</span>
    <span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">=</span><span class="pl-n">deep</span><span class="pl-p">;</span>
    <span class="pl-n">fa</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">=</span><span class="pl-n">pre</span><span class="pl-p">;</span>
    <span class="pl-n">num</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span>
    <span class="pl-k">for</span><span class="pl-p">(</span><span class="pl-n">i</span><span class="pl-o">=</span><span class="pl-n">first</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">];</span><span class="pl-n">i</span><span class="pl-o">!=-</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-n">i</span><span class="pl-o">=</span><span class="pl-n">e</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">].</span><span class="pl-n">next</span><span class="pl-p">){</span>
        <span class="pl-n">v</span><span class="pl-o">=</span><span class="pl-n">e</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">].</span><span class="pl-n">to</span><span class="pl-p">;</span>
        <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">v</span><span class="pl-o">==</span><span class="pl-n">pre</span><span class="pl-p">)</span><span class="pl-k">continue</span><span class="pl-p">;</span>
        <span class="pl-n">dfs1</span><span class="pl-p">(</span><span class="pl-n">v</span><span class="pl-p">,</span><span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-n">deep</span><span class="pl-o">+</span><span class="pl-mi">1</span><span class="pl-p">);</span>
        <span class="pl-n">num</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">+=</span><span class="pl-n">num</span><span class="pl-p">[</span><span class="pl-n">v</span><span class="pl-p">];</span>
        <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">son</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">==-</span><span class="pl-mi">1</span> <span class="pl-o">||</span> <span class="pl-n">num</span><span class="pl-p">[</span><span class="pl-n">son</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span> <span class="pl-p">]</span><span class="pl-o">&lt;</span><span class="pl-n">num</span><span class="pl-p">[</span><span class="pl-n">v</span><span class="pl-p">])</span><span class="pl-n">son</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">=</span><span class="pl-n">v</span><span class="pl-p">;</span>
    <span class="pl-p">}</span>
<span class="pl-p">}</span>
 
<span class="pl-kt">void</span> <span class="pl-nf">dfs2</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">tp</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">i</span><span class="pl-p">,</span><span class="pl-n">j</span><span class="pl-p">,</span><span class="pl-n">v</span><span class="pl-p">;</span>
    <span class="pl-n">top</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">=</span><span class="pl-n">tp</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">son</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">!=-</span><span class="pl-mi">1</span><span class="pl-p">){</span>
        <span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">=++</span><span class="pl-n">pos</span><span class="pl-p">;</span><span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">pos</span><span class="pl-p">]</span><span class="pl-o">=</span><span class="pl-n">a</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">];</span><span class="pl-n">dfs2</span><span class="pl-p">(</span><span class="pl-n">son</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">],</span><span class="pl-n">tp</span><span class="pl-p">);</span>
    <span class="pl-p">}</span>
    <span class="pl-k">else</span><span class="pl-p">{</span>
        <span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">=++</span><span class="pl-n">pos</span><span class="pl-p">;</span><span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">pos</span><span class="pl-p">]</span><span class="pl-o">=</span><span class="pl-n">a</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">];</span><span class="pl-k">return</span><span class="pl-p">;</span>
    <span class="pl-p">}</span>
    <span class="pl-k">for</span><span class="pl-p">(</span><span class="pl-n">i</span><span class="pl-o">=</span><span class="pl-n">first</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">];</span><span class="pl-n">i</span><span class="pl-o">!=-</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-n">i</span><span class="pl-o">=</span><span class="pl-n">e</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">].</span><span class="pl-n">next</span><span class="pl-p">){</span>
        <span class="pl-n">v</span><span class="pl-o">=</span><span class="pl-n">e</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">].</span><span class="pl-n">to</span><span class="pl-p">;</span>
        <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">v</span><span class="pl-o">==</span><span class="pl-n">son</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span> <span class="pl-o">||</span> <span class="pl-n">v</span><span class="pl-o">==</span><span class="pl-n">fa</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">])</span><span class="pl-k">continue</span><span class="pl-p">;</span>
        <span class="pl-n">dfs2</span><span class="pl-p">(</span><span class="pl-n">v</span><span class="pl-p">,</span><span class="pl-n">v</span><span class="pl-p">);</span>
    <span class="pl-p">}</span>
<span class="pl-p">}</span>
<span class="pl-k">struct</span> <span class="pl-n">node</span><span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-n">num</span><span class="pl-p">,</span><span class="pl-n">cl</span><span class="pl-p">,</span><span class="pl-n">cr</span><span class="pl-p">,</span><span class="pl-n">flag</span><span class="pl-p">;</span>
<span class="pl-p">}</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-mi">4</span><span class="pl-o">*</span><span class="pl-n">maxn</span><span class="pl-p">];</span>
<span class="pl-kt">void</span> <span class="pl-nf">pushup</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">th</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">lson</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-p">;</span>
    <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">cr</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">rson</span><span class="pl-p">].</span><span class="pl-n">cr</span><span class="pl-p">;</span>
    <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">num</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">lson</span><span class="pl-p">].</span><span class="pl-n">num</span><span class="pl-o">+</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">rson</span><span class="pl-p">].</span><span class="pl-n">num</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">lson</span><span class="pl-p">].</span><span class="pl-n">cr</span><span class="pl-o">==</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">rson</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-p">)</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">num</span><span class="pl-o">--</span><span class="pl-p">;</span>
<span class="pl-p">}</span>
<span class="pl-kt">void</span> <span class="pl-nf">pushdown</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">th</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">flag</span><span class="pl-o">==</span><span class="pl-mi">1</span><span class="pl-p">){</span>
        <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">lson</span><span class="pl-p">].</span><span class="pl-n">flag</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">rson</span><span class="pl-p">].</span><span class="pl-n">flag</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span>
        <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">lson</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">lson</span><span class="pl-p">].</span><span class="pl-n">cr</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">rson</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">rson</span><span class="pl-p">].</span><span class="pl-n">cr</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-p">;</span>
        <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">lson</span><span class="pl-p">].</span><span class="pl-n">num</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">rson</span><span class="pl-p">].</span><span class="pl-n">num</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span>
        <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">flag</span><span class="pl-o">=-</span><span class="pl-mi">1</span><span class="pl-p">;</span>
    <span class="pl-p">}</span>
<span class="pl-p">}</span>
<span class="pl-kt">void</span> <span class="pl-nf">build</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">th</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">mid</span><span class="pl-p">;</span>
    <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">l</span><span class="pl-o">=</span><span class="pl-n">l</span><span class="pl-p">;</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">r</span><span class="pl-o">=</span><span class="pl-n">r</span><span class="pl-p">;</span>
    <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">flag</span><span class="pl-o">=-</span><span class="pl-mi">1</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-o">==</span><span class="pl-n">r</span><span class="pl-p">){</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">cr</span><span class="pl-o">=</span><span class="pl-n">c</span><span class="pl-p">[</span><span class="pl-n">l</span><span class="pl-p">];</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">num</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-k">return</span><span class="pl-p">;}</span>
    <span class="pl-n">mid</span><span class="pl-o">=</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">l</span><span class="pl-o">+</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">r</span><span class="pl-p">)</span><span class="pl-o">/</span><span class="pl-mi">2</span><span class="pl-p">;</span>
    <span class="pl-n">build</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-n">mid</span><span class="pl-p">,</span><span class="pl-n">lson</span><span class="pl-p">);</span><span class="pl-n">build</span><span class="pl-p">(</span><span class="pl-n">mid</span><span class="pl-o">+</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-n">rson</span><span class="pl-p">);</span>
    <span class="pl-n">pushup</span><span class="pl-p">(</span><span class="pl-n">th</span><span class="pl-p">);</span>
<span class="pl-p">}</span>
 
<span class="pl-kt">void</span> <span class="pl-nf">update</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">color</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">th</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">mid</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">l</span><span class="pl-o">==</span><span class="pl-n">l</span> <span class="pl-o">&amp;&amp;</span> <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">r</span><span class="pl-o">==</span><span class="pl-n">r</span><span class="pl-p">){</span>
        <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">num</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">flag</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">cr</span><span class="pl-o">=</span><span class="pl-n">color</span><span class="pl-p">;</span><span class="pl-k">return</span><span class="pl-p">;</span>
    <span class="pl-p">}</span>
    <span class="pl-n">pushdown</span><span class="pl-p">(</span><span class="pl-n">th</span><span class="pl-p">);</span>
    <span class="pl-n">mid</span><span class="pl-o">=</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">l</span><span class="pl-o">+</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">r</span><span class="pl-p">)</span><span class="pl-o">/</span><span class="pl-mi">2</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">r</span><span class="pl-o">&lt;=</span><span class="pl-n">mid</span><span class="pl-p">)</span><span class="pl-n">update</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-n">color</span><span class="pl-p">,</span><span class="pl-n">lson</span><span class="pl-p">);</span>
    <span class="pl-k">else</span> <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-o">&gt;</span><span class="pl-n">mid</span><span class="pl-p">)</span><span class="pl-n">update</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-n">color</span><span class="pl-p">,</span><span class="pl-n">rson</span><span class="pl-p">);</span>
    <span class="pl-k">else</span><span class="pl-p">{</span><span class="pl-n">update</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-n">mid</span><span class="pl-p">,</span><span class="pl-n">color</span><span class="pl-p">,</span><span class="pl-n">lson</span><span class="pl-p">);</span><span class="pl-n">update</span><span class="pl-p">(</span><span class="pl-n">mid</span><span class="pl-o">+</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-n">color</span><span class="pl-p">,</span><span class="pl-n">rson</span><span class="pl-p">);}</span>
    <span class="pl-n">pushup</span><span class="pl-p">(</span><span class="pl-n">th</span><span class="pl-p">);</span>
<span class="pl-p">}</span>
 
<span class="pl-kt">int</span> <span class="pl-nf">question</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">th</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">L</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">R</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">mid</span><span class="pl-p">,</span><span class="pl-n">num</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">l</span><span class="pl-o">==</span><span class="pl-n">L</span><span class="pl-p">)</span><span class="pl-n">Lc</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">r</span><span class="pl-o">==</span><span class="pl-n">R</span><span class="pl-p">)</span><span class="pl-n">Rc</span><span class="pl-o">=</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">cr</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">l</span><span class="pl-o">==</span><span class="pl-n">l</span> <span class="pl-o">&amp;&amp;</span> <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">r</span><span class="pl-o">==</span><span class="pl-n">r</span><span class="pl-p">){</span>
        <span class="pl-k">return</span> <span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">num</span><span class="pl-p">;</span>
    <span class="pl-p">}</span>
    <span class="pl-n">pushdown</span><span class="pl-p">(</span><span class="pl-n">th</span><span class="pl-p">);</span>
    <span class="pl-n">mid</span><span class="pl-o">=</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">l</span><span class="pl-o">+</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">th</span><span class="pl-p">].</span><span class="pl-n">r</span><span class="pl-p">)</span><span class="pl-o">/</span><span class="pl-mi">2</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">r</span><span class="pl-o">&lt;=</span><span class="pl-n">mid</span><span class="pl-p">)</span><span class="pl-k">return</span> <span class="pl-n">question</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-n">lson</span><span class="pl-p">,</span><span class="pl-n">L</span><span class="pl-p">,</span><span class="pl-n">R</span><span class="pl-p">);</span>
    <span class="pl-k">else</span> <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-o">&gt;</span><span class="pl-n">mid</span><span class="pl-p">)</span><span class="pl-k">return</span> <span class="pl-n">question</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-n">rson</span><span class="pl-p">,</span><span class="pl-n">L</span><span class="pl-p">,</span><span class="pl-n">R</span><span class="pl-p">);</span>
    <span class="pl-k">else</span><span class="pl-p">{</span>
        <span class="pl-n">num</span><span class="pl-o">=</span><span class="pl-n">question</span><span class="pl-p">(</span><span class="pl-n">l</span><span class="pl-p">,</span><span class="pl-n">mid</span><span class="pl-p">,</span><span class="pl-n">lson</span><span class="pl-p">,</span><span class="pl-n">L</span><span class="pl-p">,</span><span class="pl-n">R</span><span class="pl-p">)</span><span class="pl-o">+</span><span class="pl-n">question</span><span class="pl-p">(</span><span class="pl-n">mid</span><span class="pl-o">+</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-n">r</span><span class="pl-p">,</span><span class="pl-n">rson</span><span class="pl-p">,</span><span class="pl-n">L</span><span class="pl-p">,</span><span class="pl-n">R</span><span class="pl-p">);</span>
        <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">lson</span><span class="pl-p">].</span><span class="pl-n">cr</span><span class="pl-o">==</span><span class="pl-n">b</span><span class="pl-p">[</span><span class="pl-n">rson</span><span class="pl-p">].</span><span class="pl-n">cl</span><span class="pl-p">)</span><span class="pl-n">num</span><span class="pl-o">--</span><span class="pl-p">;</span>
        <span class="pl-k">return</span> <span class="pl-n">num</span><span class="pl-p">;</span>
    <span class="pl-p">}</span>
<span class="pl-p">}</span>
 
<span class="pl-kt">int</span> <span class="pl-nf">solve</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">v</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">f1</span><span class="pl-o">=</span><span class="pl-n">top</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">],</span><span class="pl-n">f2</span><span class="pl-o">=</span><span class="pl-n">top</span><span class="pl-p">[</span><span class="pl-n">v</span><span class="pl-p">];</span>
    <span class="pl-kt">int</span> <span class="pl-n">num</span><span class="pl-o">=</span><span class="pl-mi">0</span><span class="pl-p">,</span><span class="pl-n">pre1</span><span class="pl-p">,</span><span class="pl-n">pre2</span><span class="pl-p">;</span>
    <span class="pl-n">pre1</span><span class="pl-o">=</span><span class="pl-n">pre2</span><span class="pl-o">=-</span><span class="pl-mi">1</span><span class="pl-p">;</span>
    <span class="pl-k">while</span><span class="pl-p">(</span><span class="pl-n">f1</span><span class="pl-o">!=</span><span class="pl-n">f2</span><span class="pl-p">){</span>
        <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">f1</span><span class="pl-p">]</span><span class="pl-o">&lt;</span><span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">f2</span><span class="pl-p">]){</span><span class="pl-n">swap</span><span class="pl-p">(</span><span class="pl-n">pre1</span><span class="pl-p">,</span><span class="pl-n">pre2</span><span class="pl-p">);</span><span class="pl-n">swap</span><span class="pl-p">(</span><span class="pl-n">f1</span><span class="pl-p">,</span><span class="pl-n">f2</span><span class="pl-p">);</span><span class="pl-n">swap</span><span class="pl-p">(</span><span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-n">v</span><span class="pl-p">);}</span>
        <span class="pl-n">num</span><span class="pl-o">+=</span><span class="pl-n">question</span><span class="pl-p">(</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">f1</span><span class="pl-p">],</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">],</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">f1</span><span class="pl-p">],</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]);</span>
        <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">pre1</span><span class="pl-o">==</span><span class="pl-n">Rc</span><span class="pl-p">)</span><span class="pl-n">num</span><span class="pl-o">--</span><span class="pl-p">;</span>
        <span class="pl-n">pre1</span><span class="pl-o">=</span><span class="pl-n">Lc</span><span class="pl-p">;</span><span class="pl-n">u</span><span class="pl-o">=</span><span class="pl-n">fa</span><span class="pl-p">[</span><span class="pl-n">f1</span><span class="pl-p">];</span><span class="pl-n">f1</span><span class="pl-o">=</span><span class="pl-n">top</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">];</span>
    <span class="pl-p">}</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">&lt;</span><span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">v</span><span class="pl-p">]){</span><span class="pl-n">swap</span><span class="pl-p">(</span><span class="pl-n">pre1</span><span class="pl-p">,</span><span class="pl-n">pre2</span><span class="pl-p">);</span><span class="pl-n">swap</span><span class="pl-p">(</span><span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-n">v</span><span class="pl-p">);}</span>
    <span class="pl-n">num</span><span class="pl-o">+=</span><span class="pl-n">question</span><span class="pl-p">(</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">v</span><span class="pl-p">],</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">],</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">v</span><span class="pl-p">],</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]);</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">Rc</span><span class="pl-o">==</span><span class="pl-n">pre1</span><span class="pl-p">)</span><span class="pl-n">num</span><span class="pl-o">--</span><span class="pl-p">;</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">Lc</span><span class="pl-o">==</span><span class="pl-n">pre2</span><span class="pl-p">)</span><span class="pl-n">num</span><span class="pl-o">--</span><span class="pl-p">;</span>
    <span class="pl-k">return</span> <span class="pl-n">num</span><span class="pl-p">;</span>
<span class="pl-p">}</span>
 
<span class="pl-kt">void</span> <span class="pl-nf">gengxin</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">v</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">value</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">f1</span><span class="pl-o">=</span><span class="pl-n">top</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">],</span><span class="pl-n">f2</span><span class="pl-o">=</span><span class="pl-n">top</span><span class="pl-p">[</span><span class="pl-n">v</span><span class="pl-p">];</span>
    <span class="pl-k">while</span><span class="pl-p">(</span><span class="pl-n">f1</span><span class="pl-o">!=</span><span class="pl-n">f2</span><span class="pl-p">){</span>
        <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">f1</span><span class="pl-p">]</span><span class="pl-o">&lt;</span><span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">f2</span><span class="pl-p">]){</span><span class="pl-n">swap</span><span class="pl-p">(</span><span class="pl-n">f1</span><span class="pl-p">,</span><span class="pl-n">f2</span><span class="pl-p">);</span><span class="pl-n">swap</span><span class="pl-p">(</span><span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-n">v</span><span class="pl-p">);}</span>
        <span class="pl-n">update</span><span class="pl-p">(</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">f1</span><span class="pl-p">],</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">],</span><span class="pl-n">value</span><span class="pl-p">,</span><span class="pl-mi">1</span><span class="pl-p">);</span>
        <span class="pl-n">u</span><span class="pl-o">=</span><span class="pl-n">fa</span><span class="pl-p">[</span><span class="pl-n">f1</span><span class="pl-p">];</span>
        <span class="pl-n">f1</span><span class="pl-o">=</span><span class="pl-n">top</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">];</span>
    <span class="pl-p">}</span>
    <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">&lt;</span><span class="pl-n">dep</span><span class="pl-p">[</span><span class="pl-n">v</span><span class="pl-p">])</span><span class="pl-n">swap</span><span class="pl-p">(</span><span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-n">v</span><span class="pl-p">);</span>
    <span class="pl-n">update</span><span class="pl-p">(</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">v</span><span class="pl-p">],</span><span class="pl-n">p</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">],</span><span class="pl-n">value</span><span class="pl-p">,</span><span class="pl-mi">1</span><span class="pl-p">);</span>
<span class="pl-p">}</span>
<span class="pl-kt">void</span> <span class="pl-nf">add</span><span class="pl-p">(</span><span class="pl-kt">int</span> <span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-kt">int</span> <span class="pl-n">v</span><span class="pl-p">)</span>
<span class="pl-p">{</span>
    <span class="pl-n">tot</span><span class="pl-o">++</span><span class="pl-p">;</span>
    <span class="pl-n">e</span><span class="pl-p">[</span><span class="pl-n">tot</span><span class="pl-p">].</span><span class="pl-n">next</span><span class="pl-o">=</span><span class="pl-n">first</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">];</span><span class="pl-n">e</span><span class="pl-p">[</span><span class="pl-n">tot</span><span class="pl-p">].</span><span class="pl-n">to</span><span class="pl-o">=</span><span class="pl-n">v</span><span class="pl-p">;</span>
    <span class="pl-n">first</span><span class="pl-p">[</span><span class="pl-n">u</span><span class="pl-p">]</span><span class="pl-o">=</span><span class="pl-n">tot</span><span class="pl-p">;</span>
<span class="pl-p">}</span>
<span class="pl-kt">int</span> <span class="pl-nf">main</span><span class="pl-p">()</span>
<span class="pl-p">{</span>
    <span class="pl-kt">int</span> <span class="pl-n">i</span><span class="pl-p">,</span><span class="pl-n">j</span><span class="pl-p">,</span><span class="pl-n">n</span><span class="pl-p">,</span><span class="pl-n">m</span><span class="pl-p">,</span><span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-n">v</span><span class="pl-p">,</span><span class="pl-n">f</span><span class="pl-p">,</span><span class="pl-n">g</span><span class="pl-p">,</span><span class="pl-n">h</span><span class="pl-p">;</span>
    <span class="pl-kt">char</span> <span class="pl-n">s</span><span class="pl-p">[</span><span class="pl-mi">10</span><span class="pl-p">];</span>
    <span class="pl-k">while</span><span class="pl-p">(</span><span class="pl-n">scanf</span><span class="pl-p">(</span><span class="pl-s">&quot;%d%d&quot;</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">n</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">m</span><span class="pl-p">)</span><span class="pl-o">!=</span><span class="pl-n">EOF</span><span class="pl-p">)</span>
    <span class="pl-p">{</span>
        <span class="pl-n">memset</span><span class="pl-p">(</span><span class="pl-n">first</span><span class="pl-p">,</span><span class="pl-o">-</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-k">sizeof</span><span class="pl-p">(</span><span class="pl-n">first</span><span class="pl-p">));</span>
        <span class="pl-n">memset</span><span class="pl-p">(</span><span class="pl-n">son</span><span class="pl-p">,</span><span class="pl-o">-</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-k">sizeof</span><span class="pl-p">(</span><span class="pl-n">son</span><span class="pl-p">));</span>
        <span class="pl-n">pos</span><span class="pl-o">=</span><span class="pl-mi">0</span><span class="pl-p">;</span><span class="pl-n">tot</span><span class="pl-o">=</span><span class="pl-mi">0</span><span class="pl-p">;</span>
        <span class="pl-k">for</span><span class="pl-p">(</span><span class="pl-n">i</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-n">i</span><span class="pl-o">&lt;=</span><span class="pl-n">n</span><span class="pl-p">;</span><span class="pl-n">i</span><span class="pl-o">++</span><span class="pl-p">){</span>
            <span class="pl-n">scanf</span><span class="pl-p">(</span><span class="pl-s">&quot;%d&quot;</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">a</span><span class="pl-p">[</span><span class="pl-n">i</span><span class="pl-p">]);</span>
        <span class="pl-p">}</span>
        <span class="pl-k">for</span><span class="pl-p">(</span><span class="pl-n">i</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-n">i</span><span class="pl-o">&lt;=</span><span class="pl-n">n</span><span class="pl-o">-</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-n">i</span><span class="pl-o">++</span><span class="pl-p">){</span>
            <span class="pl-n">scanf</span><span class="pl-p">(</span><span class="pl-s">&quot;%d%d&quot;</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">v</span><span class="pl-p">);</span>
            <span class="pl-n">add</span><span class="pl-p">(</span><span class="pl-n">u</span><span class="pl-p">,</span><span class="pl-n">v</span><span class="pl-p">);</span><span class="pl-n">add</span><span class="pl-p">(</span><span class="pl-n">v</span><span class="pl-p">,</span><span class="pl-n">u</span><span class="pl-p">);</span>
        <span class="pl-p">}</span>
        <span class="pl-n">dfs1</span><span class="pl-p">(</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-mi">0</span><span class="pl-p">,</span><span class="pl-mi">1</span><span class="pl-p">);</span><span class="pl-n">dfs2</span><span class="pl-p">(</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-mi">1</span><span class="pl-p">);</span><span class="pl-n">build</span><span class="pl-p">(</span><span class="pl-mi">1</span><span class="pl-p">,</span><span class="pl-n">pos</span><span class="pl-p">,</span><span class="pl-mi">1</span><span class="pl-p">);</span>
        <span class="pl-k">for</span><span class="pl-p">(</span><span class="pl-n">i</span><span class="pl-o">=</span><span class="pl-mi">1</span><span class="pl-p">;</span><span class="pl-n">i</span><span class="pl-o">&lt;=</span><span class="pl-n">m</span><span class="pl-p">;</span><span class="pl-n">i</span><span class="pl-o">++</span><span class="pl-p">){</span>
            <span class="pl-n">scanf</span><span class="pl-p">(</span><span class="pl-s">&quot;%s&quot;</span><span class="pl-p">,</span><span class="pl-n">s</span><span class="pl-p">);</span>
            <span class="pl-k">if</span><span class="pl-p">(</span><span class="pl-n">s</span><span class="pl-p">[</span><span class="pl-mi">0</span><span class="pl-p">]</span><span class="pl-o">==</span><span class="pl-sc">&#39;Q&#39;</span><span class="pl-p">){</span>
                <span class="pl-n">scanf</span><span class="pl-p">(</span><span class="pl-s">&quot;%d%d&quot;</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">f</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">g</span><span class="pl-p">);</span>
                <span class="pl-n">printf</span><span class="pl-p">(</span><span class="pl-s">&quot;%d</span><span class="pl-se">\n</span><span class="pl-s">&quot;</span><span class="pl-p">,</span><span class="pl-n">solve</span><span class="pl-p">(</span><span class="pl-n">f</span><span class="pl-p">,</span><span class="pl-n">g</span><span class="pl-p">));</span>
            <span class="pl-p">}</span>
            <span class="pl-k">else</span><span class="pl-p">{</span>
                <span class="pl-n">scanf</span><span class="pl-p">(</span><span class="pl-s">&quot;%d%d%d&quot;</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">f</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">g</span><span class="pl-p">,</span><span class="pl-o">&amp;</span><span class="pl-n">h</span><span class="pl-p">);</span>
                <span class="pl-n">gengxin</span><span class="pl-p">(</span><span class="pl-n">f</span><span class="pl-p">,</span><span class="pl-n">g</span><span class="pl-p">,</span><span class="pl-n">h</span><span class="pl-p">);</span>
            <span class="pl-p">}</span>
        <span class="pl-p">}</span>
    <span class="pl-p">}</span>
    <span class="pl-k">return</span> <span class="pl-mi">0</span><span class="pl-p">;</span>
<span class="pl-p">}</span>
</cpde></pre></div>